<template>
    <div>
        <el-input-number
            :placeholder="$attrs.placeholder || '请输入内容'"
            :disabled="state === 'disabled'"
            v-model.number="formData"
            clearable
            step-strictly
            :min="$attrs.min || 0"
            :max="$attrs.max || Infinity"
            v-bind="$attrs"
        ></el-input-number>
    </div>
</template>

<script>
export default {
    components: {},
    props: {
        value: {
            default: false,
        },
        state: {
            default: "write",
        },
    },
    data() {
        return {};
    },
    computed: {
        formData: {
            get() {
                return this.value;
            },
            set(val) {
                this.$emit("input", val);
            },
        },
    },
    created() {},
    mounted() {},
    methods: {},
};
</script>

<style lang="scss" scoped>
::v-deep .el-input-number {
    width: 100%;
    .el-input-number__decrease,
    .el-input-number__increase {
        display: none;
    }
    input {
        padding: 5px;
        text-align: left;
        width: 100%;
        // min-width: 200px;
    }
}
</style>
